package com.crm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.crm.entity.OpenClose;
import com.crm.service.OpenCloseService;
import com.crm.util.Result;

//开关控制层
@RestController
@RequestMapping("/openClose")
public class OpenCloseController {
	@Autowired
	private OpenCloseService openCloseService;
	/**
	 *  查询开关
	 * @return
	 */
	@RequestMapping("/getAll")
	public Object getAll() {
		Result result = new Result("0", "true", 10, openCloseService.getAll());
		return result;
	}
	/**
	 *  根据id去修改isopens
	 * @return
	 */
	@RequestMapping("/update")
	public Object update(OpenClose openClose) {
		Result result = new Result("0", "true", openCloseService.update(openClose), "后台请求成功");
		System.out.println(openClose);
		return result;
	}
}
